<?php

class AdminRole_ProductManager extends ProductManager {


	public function __construct() {
		$this->registry = Yapary_SingletonRegistry::getInstance();
		return;
	}


	public function addProduct(Product $_product) {
		
		//TODO CHECKs?
		if($_product == null || !isset($_product)) {
			return "Fehler"; //TODO FEHLERBEHANDLUNG
		}
		
		$errOccured = false;
		
		/* @var $oProduct Produkt */
		$oProduct = $_product;
		/* @var $oSection Section */
		$oSection = $oProduct->getSection();
		/* @var $oSql Yapary_Db_Sql_Connector */
		$oSql =  $this->registry->oSql;
		
		//		$oSql->request('INSERT INTO Produkt (ProduktId, Produktname, BeschreibungLang, BeschreibungKurz, istInRubrik)
		
		
		$oSql->request('INSERT INTO Produkt (ProduktId, Produktname, BeschreibungLang, BeschreibungKurz, istInRubrik)
						VALUES ("' . $oProduct->getProductId() .  '",
				"' . $oProduct->getName() .  '",
				"' . $oProduct->getLongDesc() .  '",
				"' . $oProduct->getShortDesc() .  '",
				"' . $oProduct->getSection() .  '") ');
		
		$oSql->request('INSERT INTO Rubrik (RubrikId, Name) VALUES ("' . $oSection->getSectionId() .  '","' . $oSection->getName() .  '"');

		
		
		return;
	}


	public function editProduct(Product $_product) {

		return;
	}


	public function deleteProduct(Product $_product) {

		return;
	}


	public function checkProductFilepaths() {



		return;
	}


	public function getProduct($productName, $status) {



		return;
	}


	public function addPdfSection(Section $_section) {



		return;
	}


	public function editSection(Section $_section) {



		return;
	}


	public function deleteSection(Section $_section) {



		return;
	}


}


?>
